package com.riant.day04.demo2;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

/**
 * @Classname Test3
 * @Description TODO
 * @Date 2021/3/11 23:47
 * @Created by 张斌
 */
public class Test3 {
    public static void main(String[] args) {
        ArrayList<Integer> collection=new ArrayList<>();
        collection.add(1);
        collection.add(2);
        collection.add(3);
        Integer[] arr=new Integer[5];
        Integer[] arr2=collection.toArray(arr);
        System.out.println(Arrays.toString(arr));
        System.out.println(arr.equals(arr2));
        Iterator it= collection.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

    }
}
